package net.sunofbeach.blog.controller.portal;

import net.sunofbeach.blog.pojo.LyReply;
import net.sunofbeach.blog.response.ResponseResult;
import net.sunofbeach.blog.services.ILyReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/portal/lyReply")
public class LyReplyApi {
    @Autowired
    private ILyReplyService iLyReplyService;


    @PostMapping
    public ResponseResult postLy(@RequestBody LyReply lyReply) {
        return iLyReplyService.postLyReply(lyReply);
    }

    @GetMapping("/list/{page}/{size}")
    public ResponseResult listComments(@PathVariable("page") int page,
                                       @PathVariable("size") int size) {
        return iLyReplyService.listLysReply(page, size);
    }

    @GetMapping("/count")
    public ResponseResult getLyCount() {
        return iLyReplyService.getLyReplyCount();
    }
}
